* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    position: relative;
    overflow: hidden;
}

/* 动态背景粒子 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-10px, -10px) scale(1.1);
    }
    50% {
        transform: translate(10px, -5px) scale(0.9);
    }
    75% {
        transform: translate(-5px, 10px) scale(1.05);
    }
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.game-container.shake {
    animation: shake 0.3s ease-in-out;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 15px;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.score-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.score-board:hover::before {
    left: 100%;
}

.score-board:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.game-area {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

#gameCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

#gameCanvas:hover {
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* 画布发光效果 */
#gameCanvas::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gameCanvas:hover::after {
    opacity: 1;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.overlay-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.overlay-content h2 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.overlay-content p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #666;
}

.controls {
    text-align: center;
}

.control-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.control-info p {
    color: #555;
    font-size: 0.9em;
}

.speed-control {
    margin: 20px 0;
    text-align: center;
}

.speed-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.speed-slider {
    width: 100%;
    max-width: 300px;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 10px;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
    margin: 0 auto;
    font-size: 0.8em;
    color: #666;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#startBtn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

#pauseBtn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

#pauseBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

#restartBtn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

#restartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-container {
        margin: 20px;
        padding: 20px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .speed-control {
        margin: 15px 0;
    }
    
    .speed-slider {
        max-width: 250px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.game-overlay.show {
    display: flex;
    animation: pulse 0.3s ease-in-out;
} 